﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace EasyProp.Tests
{
    [TestFixture]
    public class AfterPropertySetFilterAttributeFixture
    {
        [Test][ExpectedException(typeof(ArgumentException))]
        public void throws_if_type_does_not_implement_IPropertySetFilter()
        {
            AfterPropertySetFilterAttribute attr = new AfterPropertySetFilterAttribute(typeof(string));
        }

        [Test]
        public void accepts_types_that_implement_IPropertySetFilter()
        {
            Type type = typeof(NotifyPropertyChanged);
            AfterPropertySetFilterAttribute attr = new AfterPropertySetFilterAttribute(type);
            Assert.AreEqual(type, attr.FilterTypes.ElementAt(0));
        }

    }
}
